import 'package:json_annotation/json_annotation.dart';

part 'area_code.g.dart';

@JsonSerializable()
class AreaCodeReq {
  final String module;
  final String etag;
  final String key;

  AreaCodeReq(this.module, this.etag, this.key);

  factory AreaCodeReq.fromJson(Map<String, dynamic> json) =>
      _$AreaCodeReqFromJson(json);

  Map<String, dynamic> toJson() => _$AreaCodeReqToJson(this);
}

@JsonSerializable()
class AreaCodeRes {
  final List<AreCodeInfo> data;

  AreaCodeRes(this.data);

  factory AreaCodeRes.fromJson(Map<String, dynamic> json) =>
      _$AreaCodeResFromJson(json);

  Map<String, dynamic> toJson() => _$AreaCodeResToJson(this);
}

@JsonSerializable()
class AreCodeInfo {
  final String code;
  final String name;

  AreCodeInfo(this.code, this.name);

  factory AreCodeInfo.fromJson(Map<String, dynamic> json) =>
      _$AreCodeInfoFromJson(json);

  Map<String, dynamic> toJson() => _$AreCodeInfoToJson(this);
}